const path=require('path')
const pathstr1=path.join('/a','/b/c','../','d') //../会掉前面的路径
const pathstr2=path.join(__dirname,'/files/test.txt') //../会掉前面的路径

const fpath='/a/b/index.html'
const file1=path.basename(fpath)            //index.html
const file2=path.basename(fpath,'.html') //index
const file3=path.extname(fpath) //.html

console.log(pathstr1,pathstr2,file1,file2,file3)